package com.ibeeking.found.org.service.common.param;

import com.ibeeking.nematos.utils.base.BaseValidationGroup;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @ClassName EmployeeFieldParam
 * @Description
 * @Author ibeeking
 * @Date 2022-01-24 11:39
 **/
@Data
public class EmployeeFieldParam implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(message = "Id不能为空!", groups = {BaseValidationGroup.Update.class})
    private Long id;

    /**
     * 字段编码 标识字段的key
     */
    @NotBlank(message = "字段编码不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private String code;

    /**
     * 字段名
     */
    @NotBlank(message = "字段名不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private String name;

    /**
     * 字段数据类型
     */
    @NotNull(message = "字段数据类型不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private Integer dataType;

    /**
     * 字段配置类型 0-固有字段 1-自定义字段
     */
    @NotNull(message = "字段配置类型不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private Integer fieldType;

    /**
     * 字段长度
     */
    @NotNull(message = "字段长度不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private Integer dataLength;

    /**
     * 字段输入提示
     */
    private String dataPrompt;

    /**
     * 数据选项
     */
    @Valid
    private List<EmployeeFieldOptionsItemParam> optionsItemList;

    /**
     * 字段是否可修改 0-否 1-是
     */
    @NotNull(message = "字段是否可修改不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private Integer hasModify;

    /**
     * 字段是否要显示 0-否 1-是
     */
    @NotNull(message = "字段是否要显示不能为空!", groups = {BaseValidationGroup.Update.class, BaseValidationGroup.Insert.class})
    private Integer hasShow;

    /**
     * 创建人
     */
    private Long createBy;

    /**
     * 更新人
     */
    private Long modifyBy;
}
